import request from '@/config/axios'
import type { Vip } from './types'

export const getVipsListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/vips', params })
}

export const createVipsApi = (data: Partial<Vip>): Promise<IResponse> => {
  return request.post({ url: '/vips', data })
}

export const updateVipsApi = (id: string, data: Partial<Vip>): Promise<IResponse> => {
  return request.put({ url: `/vips/id/${id}`, data })
}

export const getVipsDetailApi = (id: string): Promise<IResponse<Vip>> => {
  return request.get({ url: `/vips/id/${id}` })
}

export const delVipsListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/vips/id/${ids[0]}` })
}
